<?php
class ClaycodeMenu
{
	private $arr_menuItems;
	private $s_menuId;
	
	public function __construct()
	{
		$this->arr_menuItems = array();	
	}
	
	public function getMenuItems()
	{
		return $this->arr_menuItems;
	}
	
	public function getMenuItem($s_itemId)
	{
		return $this->arr_menuItems[$s_itemId];
	}
	
	public function getMenuId()
	{
		return $this->s_menuId;
	}
	
	public function setMenuItem()
	{
		$this->arr_menuItems[$s_itemId] = $o_item;
	}
	
	public function setMenuItems($arr_menuItems)
	{
		$this->arr_menuItems = $arr_menuItems;
	}
	
	public function setMenuId($s_menuId)
	{
		$this->s_menuId = $s_menuId;
	}
	
}

class ClaycodeMenuItem
{
	private $s_itemId;
	private $s_itemContent;
	private $b_isDefault;
	
	public function __construct($s_itemId, $s_itemContent, $b_isDefault)
	{
		$this->setItemId($s_itemId);
		$this->setItemContent($s_itemContent);
		$this->setIsDefault($b_isDefault);
	}
	
	public function getItemId()
	{
		return $this->s_itemId;		
	}
	
	public function getItemContent()
	{
		return $this->s_itemContent;
	}
	
	public function getIsDefault()
	{
		return $this->b_isDefault;
	}
	
	public function setItemId($s_itemId)
	{
		$this->s_itemId = $s_itemId;
	}
	
	public function setItemContent($s_itemContent)
	{
		$this->s_itemContent = $s_itemContent;
	}
	
	public function setIsDefault($b_isDefault)
	{
		$this->b_isDefault = $b_isDefault;
	}
}

class ClaycodeMenuHtml
{
	private $o_menu;
	private $arr_options;
	private $s_menuHtml;
	
	public function __construct($o_menu, $arr_options)
	{
		$this->o_menu = $o_menu;
		$this->assemble();	
	}
	
	public function getMenuHtml()
	{
		return $this->s_menuHtml;
	}
	
	private function assemble()
	{
		$arr_o_menuItems = $this->o_menu->getMenuItems();
		
		
	}
	
	private function makeMenu()
	{
	
	}
	
}

class ClaycodeMenuMaker
{
	private $arr_options;
	private $arr_o_menuItems;
	private $o_menu;
	
	public function __construct($arr_options)
	{
		$this->arr_options = $arr_options;
		$this->arr_o_menuItems = array();
		
		$this->makeMenu();
	}
	
	public function assembleMenu()
	{
		$this->o_menu->setMenuItems($this->arr_o_menuItems);
	}
	
	public function gethtml()
	{
		$o_htmlMaker = new ClaycodeMenuHtml($this->o_menu);
	}
	
	private function makeMenu()
	{
		//create the instance of the menu object
		$this->o_menu = new ClaycodeMenu();
		$this->o_menu->setMenuId($this->arr_options['menu_id']);
	}
	
	public function getMenu()
	{
		return $this->o_menu;	
	}
	
	public function getMenuItem($s_itemId)
	{
		//return an instance of a menu item
		return $this->arr_o_menuItems[$s_itemId];
	}
	
	public function setDefaultItem($s_itemId)
	{
		$o_item = $this->getMenuItem($s_itemId);
		$o_item->setIsdefault(true);
	}
	
	public function setMenuItemObject($s_itemId, $o_item)
	{
		$this->arr_o_menuItems[$s_itemId] = $o_item;
	}
	
	public function setMenuItem($s_itemId, $s_itemContent, $b_isDefault)
	{
		//create an instance of a menu item then set it into the class attribute
		$o_item = new ClaycodeMenuItem($s_itemId, $s_itemContent, $b_isDefault);
		$this->setMenuItemObject($s_itemId, $o_item);
	}
	
}